function jsBlackjack()
{
	jsBlackjack.prototype.m_nDeckCount = 8;
	
	this.m_aTables = new Array();
	this.m_oMain = document.getElementById("main_body");
	
	jsBlackjack.prototype.AddTable = _jsBlackjackAddTable;
	jsBlackjack.prototype.RemoveTable = _jsBlackjackRemoveTable;
	jsBlackjack.prototype.CloneTable = _jsBlackjackCloneTable;
	
	jsBlackjack.prototype.Render = _jsBlackjackRender;
}

function _jsBlackjackAddTable()
{
	this.m_aTables.push(new jsTable(this.m_nDeckCount,5,250,this));
	this.m_aTables[this.m_aTables.length-1].id=this.m_aTables.length-1;
	jsDebug.Throw(this,254,this.m_aTables);
}

function _jsBlackjackRemoveTable(_index)
{
	this.m_aTables.splice(_index,1);
	//re assign ids
	for(var ia=_index;ia<this.m_aTables.length;ia++)
	{
		this.m_aTables[ia].id=ia;
	}
	jsDebug.Throw(this,254,this.m_aTables);
}

function _jsBlackjackCloneTable(_toClone)
{
	this.m_aTables.push(new jsTable(this.m_nDeckCount,_toClone.minBet,_toClone.maxBet,this));
	this.m_aTables[this.m_aTables.length-1].id=this.m_aTables.length-1;
	jsDebug.Throw(this,254,this.m_aTables);
}

function _jsBlackjackRender()
{
	for(var ia=0;ia<this.m_aTables.length;ia++)
	{
		this.m_aTables[ia].Render(this.m_oMain);
	}
}